import { request } from './request'


// 图片上传接口
// export const uploadUrl = '/upload'
// export const uploadUrl = 'http://localhost:82/front/file/upload'
// export const baseImgUrl = 'http://localhost:82'
export const uploadUrl = 'http://ol.wanmei.iego.cn:8444/front/file/upload'
export const baseImgUrl = 'http://ol.wanmei.iego.cn:8444'
// /upload


//登录模块

export function login(data) {
    return request({
        url: "/back/login",
        method: "post",
        data: data,
    });
}

export function userList(data) {
    return request({
        url: "/back/users/" + data.current + "/" + data.size,
        method: "get",
        // data: data,
    });
}
export function deleteUser(userId) {
    return request({
        url: "/back/user/" + userId,
        method: "delete",
    });
}
export function getOneUser(userId) {
    return request({
        url: "/back/user/" + userId,
        method: "get",
    });
}
export function updateUser(data) {
    return request({
        url: "/back/users",
        method: "put",
        data: data
    });
}
export function saveUser(data) {
    return request({
        url: "/back/users",
        method: "post",
        data: data
    });
}


//公告咨询模块接口
export function annoList(data) {
  return request({
    url: "/back/annos/" + data.current + "/" + data.size,
    method: "get",
    // data: data,
  });
}
export function deleteAnno(annoId) {
  return request({
    url: "/back/anno/" + annoId,
    method: "delete",
  });
}
export function getOneAnno(annoId) {
  return request({
    url: "/back/anno/" + annoId,
    method: "get",
  });
}
export function updateAnno(data) {
  return request({
    url: "/back/annos",
    method: "put",
    data: data
  });
}
export function saveAnno(data) {
  return request({
    url: "/back/annos",
    method: "post",
    data: data
  });
}


//留言箱模块接口
export function msgBoxList(params) {
  return request({
    url: "/back/messageBoxes",
    params,
    method: "get",
    // data: data,
  });
}
export function deleteMsgBox(annoId) {
  return request({
    url: "/back/messageBox/" + annoId,
    method: "delete",
  });
}
export function getOneMsgBox(annoId) {
  return request({
    url: "/back/messageBox/" + annoId,
    method: "get",
  });
}
export function updateMsgBox(data) {
  return request({
    url: "/back/messageBox",
    method: "put",
    data
  });
}
export function saveMsgBox(data) {
  return request({
    url: "/back/messageBox",
    method: "post",
    data: data
  });
}


//医院块接口
export function hospitalList(params) {
  return request({
    url: "/back/hospitalInformation/getHospitalInfo",
    params,
    method: "get",
    // data: data,
  });
}
export function deleteHospital(hostpitalId) {
  return request({
    url: "/back/hospitalInformation/delHospital/" + hostpitalId,
    method: "delete",
  });
}
export function getOneHospital(hostpitalId) {
  return request({
    url: "/back/hospitalInformation/getHospital/" + hostpitalId,
    method: "get",
  });
}

export function updateHospital(data) {
  return request({
    url: "/back/hospitalInformation/getHospitalInfo",
    method: "put",
    data
  });
}
export function saveHospital(data) {
  return request({
    url: "/back/hospitalInformation/addHospital",
    method: "post",
    data
  });
}


// 疫苗信息类的接口 ===============================================================
// 疫苗信息查询
export function vaccineList(params) {
  return request({
    url: "/back/vaccineInfos",
    method: "get",
    params
  });
}
// 疫苗信息删除查询
export function deleteVaccine(id) {
  return request({
    url: "/back/vaccineInfo/"+id,
    method: "delete"
  });
}
// 疫苗信息添加
export function addVaccine(data) {
  return request({
    url: "/back/vaccineInfos",
    method: "post",
    data
  });
}
//获取单个疫苗信息
export function getOneVaccine(vaccineSortId) {
  return request({
    url: "/back/vaccineInfo/" + vaccineSortId,
    method: "get",
  });
}
//修改疫苗信息
export function updateVaccine(data) {
  return request({
    url: "/back/vaccineInfos",
    method: "put",
    data
  });
}









//疫苗分类接口
export function vaccineSortList(data) {
  return request({
    url: "/back/vaccineSorts/" + data.current + "/" + data.size,
    method: "get",
    // data: data,
  });
}

//疫苗分类筛选接口
export function vaccineSortQueryList(params) {
  return request({
    url: "/back/vaccineSorts",
    params,
    method: "get",
  });
}

export function deleteVaccineSort(vaccineSortId) {
  return request({
    url: "/back/vaccineSort/" + vaccineSortId,
    method: "delete",
  });
}
export function getOneVaccineSort(vaccineSortId) {
  return request({
    url: "/back/vaccineSort/" + vaccineSortId,
    method: "get",
  });
}

export function updateVaccineSort(data) {
  return request({
    url: "/back/vaccineSorts",
    method: "put",
    data: data
  });
}
export function saveVaccineSort(data) {
  return request({
    url: "/back/vaccineSorts",
    method: "post",
    data: data
  });
}


//模糊搜索医院名称
export function vagueHospitalList(params) {
  return request({
    url: "/back/vaccineSortsVague",
    method: "get",
    params
  });
}












// 订单模块接口
export function getVaccineAppointment(params) {
    return request({
        url: "/back/vaccineOrder",
        method: "get",
        params
    });
}


//公告咨询模块接口
export function vaccineInformationList(data) {
  return request({
    url: "/back/vaccineInfo/" + data.current + "/" + data.size,
    method: "get",
    // data: data,
  });
}










// export function deleteAnno(annoId) {
//   return request({
//     url: "/back/anno/" + annoId,
//     method: "delete",
//   });
// }
// export function getOneAnno(annoId) {
//   return request({
//     url: "/back/anno/" + annoId,
//     method: "get",
//   });
// }
// export function updateAnno(data) {
//   return request({
//     url: "/back/annos",
//     method: "put",
//     data: data
//   });
// }
// export function saveAnno(data) {
//   return request({
//     url: "/back/annos",
//     method: "post",
//     data: data
//   });
// }
